Skip to content

fix(arborist): handle directories named yarn.lock - #9905

Open
Fnine59 wants to merge 1 commit into
npm:latestfrom
Fnine59:fix/npm-yarn-lock-directory-8782
Open

fix(arborist): handle directories named yarn.lock#9905
Fnine59 wants to merge 1 commit into
npm:latestfrom
Fnine59:fix/npm-yarn-lock-directory-8782

Conversation

@Fnine59

@Fnine59 Fnine59 commented Aug 21, 2026

Copy link
Copy Markdown

What / Why

A directory named yarn.lock currently makes Arborist's parallel lockfile read reject. The rejected Promise.all discards any package-lock contents read alongside it, and save() then fails with ERR_INVALID_ARG_TYPE because lockfile selection never completes.

Treat EISDIR as absence only for the optional yarn.lock input. All other yarn lock errors and every package-lock error retain the existing load-error handling.

The regression tests cover both an existing package lock, whose data must survive load and save, and a project without one, where save must create package-lock.json while leaving the yarn.lock directory intact.

References

Fixes #8782

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] npm install throws "ERR_INVALID_ARG_TYPE" if empty yarn.lock folder is present in root directory.

1 participant